<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>旅游吧首页</title>
    <link rel="stylesheet" type="text/css" href="/css/public.css"/>
    <link rel="stylesheet" type="text/css" href="/css/PlayZhejiang.css"/>
    <link rel="stylesheet" type="text/css" href="/css/NumberShow.css"/>
    <!-- 引入 layui.css -->
    <link href="//unpkg.com/layui@2.9.11/dist/css/layui.css" rel="stylesheet">
</head>
<body>
<div class="nav">
    <div class="container">
        <ul>
            <li><a th:href="@{/index}">首页</a></li>
            <li><a th:href="@{/travelNotes/getTravelNotesList}">旅游游记</a></li>
        </ul>
        <div style="float: right;margin-top: 13px;">
            <!-- 如果用户已登录，显示用户名 -->
            <span th:if="${session.currentUser != null}" style="margin-right: 10px;">欢迎，<span th:text="${session.currentUser.name}"></span></span>
            <!-- 如果用户未登录，显示登录按钮 -->
            <a th:if="${session.currentUser == null}" th:href="@{/user/toLogin}" class="layui-btn layui-btn-normal layui-btn-radius">登录</a>
            <!-- 如果用户已登录，显示发布旅游游记按钮 -->
            <a th:if="${session.currentUser != null}" th:href="@{/travelNotes/toAddPage}" class="layui-btn layui-btn-normal layui-btn-radius">发布旅游游记</a>
            <a th:if="${session.currentUser != null}" th:href="@{/user/logout}">退出登录</a>

        </div>
    </div>
</div>
<div class="banner">
    <img src="/img/banner-lygl-list.png">
    <h1></h1>
</div>
<div class="centerbox">
    <div class="container">
        <div class="thisposition">
            <a style="font-size: 20px;">首页</a><span></span><a style="font-size: 20px;"> >>&nbsp;&nbsp;&nbsp;热门推荐</a>
        </div>

        <ul class="list">
            <div th:each="scenicspot : ${scenicspots}">
                <li>
                    <a>
                        <img th:src="@{${scenicspot.scenicspot_img}}">
                        <h3 th:text="${scenicspot.getScenicspot_addr()}">景点名称</h3>
                    </a>
                </li>
                <li></li>
            </div>
        </ul>
    </div>
</div>
<div class="footer">
    <div class="logo"><img src="/img/footer-logo.png"></div>
    <p>联系电话：0571-96118</p>
</div>
</body>
</html>
